#!/usr/bin/perl

use warnings;
use strict;

open (SAMPLE, "sample.file");

my $i = 1;
foreach (<SAMPLE>) {
    if ( $i >= 2 && $i <= 6) {
        print;
    }
    $i++;
}

close SAMPLE;
